//2009/07/25 20:06:30
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

class YahtzeeScore
{
public:
    int maxPoints(vector <int> toss)
	{
		sort(toss.begin(), toss.end());
		int Max = 0;
		int count = 1;
		int pre = toss[toss.size() -1];
		for(int i=toss.size() - 2; i>=0; i--)
		{
			if(toss[i] != pre)
			{
				Max = max(Max, count*pre);
				count = 1;
				pre = toss[i];
			}
			else
			{
				count ++;
			}
		}
		Max = max(Max, pre*count);
		return Max;
	}
};
